package com.ihr360.job.core.step.skip;

import com.ihr360.job.core.UnexpectedJobExecutionException;

/**
 * Special exception to indicate a failure in a skip policy. These need
 * special treatment in the framework in case a skip sends itself into an
 * infinite loop.
 *
 * @author Dave Syer
 *
 */
@SuppressWarnings("serial")
public class SkipPolicyFailedException extends UnexpectedJobExecutionException {

    /**
     * @param message describes the error to the user
     * @param ex the exception that was thrown by a {@link SkipPolicy}
     * @param t the exception that caused the skip
     */
    public SkipPolicyFailedException(String message, RuntimeException ex, Throwable t) {
        super(message + "\n" + t.getClass().getName() + ": " + t.getMessage(), ex);
    }

}